import axios from "axios";
// 创建axios对象
const request = axios.create({
    timeout: 5000
});
// 给axios对象设置一个拦截器，当每次发送axios请求时，都会设置请求头,表示向后端发送json数据
request.interceptors.request.use(config=>{
    config.headers['content-type'] = "application/json;charset=utf-8";
    return config;
});
export default request     // 将axios对象导出